<%@ page language="java" pageEncoding="UTF-8"%><%@ page import="com.wap.framework.util.Constants;"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath+"admin" + "/"%>">
		<title>图片管理</title>
		<link rel="stylesheet" type="text/css" href="skin/css/base.css">
		<script language="javascript" type="text/javascript"
			src="skin/js/frame/dynamic_page.js"></script>
		<script type="text/javascript">
			function doForward()
			{
				document.imageFM.target = "main";
				document.location = "<%=path%>/admin/image_upload.jsp";				
			}
			
			function doDelete()
			{
				var selCount = 0;
				var ids = document.imageFM.id;
				for(var i = 0; i < ids.length; i++)
				{					
					if(ids[i].type == "checkbox" && ids[i].checked)
					{
						selCount++;
					}
				}
				
				if(selCount == 0)
				{
					alert("至少选择一项!");
					return;
				}
				
				document.imageFM.action = "<%=path%>/imageMgr.do";
				document.imageFM.target = "main";								
				document.imageFM.submit();
			}
		</script>
	</head>

	<body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>
		<!--  图片列表   -->
		<form name="imageFM" method="post">
			<input type="hidden" name="action_method" value="delete">
			<table width="98%" border="0" cellpadding="2" cellspacing="1"
				bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="10" background="skin/images/tbg.gif">
						&nbsp;图片列表&nbsp;
					</td>
				</tr>
				<tr align="center" bgcolor="#FAFAF1" height="22">
					<td width="3%">
						选择
					</td>
					<td width="4%">
						ID
					</td>					
					<td width="10%">
						图片名称
					</td>
					<td width="200">
						图片预览
					</td>
					<td width="30%">
						存放路径
					</td>
					<td width="10%">
						创建时间
					</td>
					<td width="10%">
						上次修改时间
					</td>									
					<td width="8%">
						状态
					</td>					
					<td width="5%">
						操作
					</td>
				</tr>
				<c:forEach items="${images}" var="imageColl">
					<tr align='center' bgcolor="#FFFFFF"
					onMouseMove="javascript:this.bgColor='#FCFDEE';"
					onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td>
						<input name="id" type="checkbox" value="${imageColl.id}" class="np">
					</td>
					<td>
						${imageColl.id}
					</td>					
					<td align="left">
						<a href='<%=path%>/imageMgr.do?action_method=edit&imageId=${imageColl.id}'><u>${imageColl.displayName}</u></a>
					</td>
					<td>
					<img src="<%=Constants.UPLOAD_IMAGES_PATH%>/${imageColl.displayName}" width="200" />
					</td>
					<td align="left">
						 <%=Constants.UPLOAD_IMAGES_PATH%>/${imageColl.displayName}
					</td>
					<td>
						<fmt:formatDate value="${imageColl.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>
					<td>
						<fmt:formatDate value="${imageColl.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>										
					<td>
						<c:if test="${imageColl.status == 0}">
							停止浏览
						</c:if>
						<c:if test="${imageColl.status == 1}">
							开放浏览
						</c:if>						
					</td>					
					<td>
						<a href="<%=path%>/imageMgr.do?action_method=edit&imageId=${imageColl.id}" target='main'>编辑</a>
					</td>
				</tr>
				</c:forEach>			
				
				<tr bgcolor="#FAFAF1">
					<td height="28" colspan="10">
						&nbsp;						
						<input class="coolbg" type="button" value="全选" onclick="selAll()"/>
						<input class="coolbg" type="button" value="取消" onclick="noSelAll()"/>
						<input class="coolbg" type="button" value="上传图片" onclick="doForward()"/>
						<input class="coolbg" type="button" value="删除" onclick="doDelete()"/>						
					</td>
				</tr>
								
				<tr align="right" bgcolor="#EEF4EA">
					<td height="25" colspan="10" align="center">
						翻页代码
					</td>
				</tr>
			</table>
		</form>		
	</body>
</html>
